package com.hccl.sluentities;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.ArrayList;
import java.util.List;
import org.bson.types.ObjectId;
import org.mongodb.morphia.annotations.Entity;
import org.mongodb.morphia.annotations.Id;


/**
 * Created by xjzhang on 2017/11/3.
 */
@Entity(value = "process", noClassnameStored = true)
public class ProcessEntity {

    @Id
    protected ObjectId id;

    String name;

    String init_step;

    List<StepEntity> steps = new ArrayList<StepEntity>();

    public ProcessEntity() {

    }

    public ProcessEntity(@JsonProperty("name") String name,
                      @JsonProperty("init_step") String init_step,
                   @JsonProperty("steps") List<StepEntity> steps) {
        this.name = name != null ? name : "";
        this.init_step = init_step != null ? init_step : "";
        this.steps = steps;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInit_step() {
        return init_step;
    }

    public void setInit_step(String init_step) {
        this.init_step = init_step;
    }

    public List<StepEntity> getSteps() {
        return steps;
    }

    public void setSteps(List<StepEntity> steps) {
        this.steps = steps;
    }
}
